$(document).ready(function(){
	testRequestBody();
});
function testRequestBody(){
var requestObject = {id: 1, name: "Spring MVC 企业应用"};	
console.log("requestObject: " + requestObject);
var requestData = JSON.stringify(requestObject);
console.log("requestData: " + requestData);

	$.ajax(
			{
				url: "/book",
				dataType: "json", //data type which is expected server will return 
				type: "post",
				contentType:"application/json",
				data: requestData,
				async: true,
				success : function (data){
					console.log(data);
					$("#id").html(data.id);
					$("#name").html(data.name);
					$("#author").html(data.author);
				},
				error: function(err){
					console.log("err: " + err);
				}
			}
		);
}